From f99e0aba70efad0deb907d8e27f09fc9f527c8a4 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 17 Feb 2023 17:07:50 +0700 Subject: Refactor --- src/pages/shop/brands/[slug].jsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/pages/shop/brands/[slug].jsx (limited to 'src/pages/shop/brands/[slug].jsx') diff --git a/src/pages/shop/brands/[slug].jsx b/src/pages/shop/brands/[slug].jsx new file mode 100644 index 00000000..4965d4f7 --- /dev/null +++ b/src/pages/shop/brands/[slug].jsx @@ -0,0 +1,23 @@ +import BasicLayout from "@/core/components/layouts/BasicLayout" +import { getIdFromSlug, getNameFromSlug } from "@/core/utils/slug" +import ProductSearch from "@/lib/product/components/ProductSearch" +import { useRouter } from "next/router" +import _ from "lodash" +import Brand from "@/lib/brand/components/Brand" + +export default function BrandDetail() { + const router = useRouter() + const { slug = '' } = router.query + return ( + + + { !_.isEmpty(router.query) && ( + + ) } + + ) +} \ No newline at end of file -- cgit v1.2.3 From 69f55de26319e570ce0a8c4dbe8a29cb0d0b51c5 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Sat, 18 Feb 2023 22:03:55 +0700 Subject: optimization --- src/pages/shop/brands/[slug].jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pages/shop/brands/[slug].jsx') diff --git a/src/pages/shop/brands/[slug].jsx b/src/pages/shop/brands/[slug].jsx index 4965d4f7..da3ee84d 100644 --- a/src/pages/shop/brands/[slug].jsx +++ b/src/pages/shop/brands/[slug].jsx @@ -1,9 +1,11 @@ -import BasicLayout from "@/core/components/layouts/BasicLayout" +import dynamic from "next/dynamic" import { getIdFromSlug, getNameFromSlug } from "@/core/utils/slug" -import ProductSearch from "@/lib/product/components/ProductSearch" import { useRouter } from "next/router" import _ from "lodash" -import Brand from "@/lib/brand/components/Brand" + +const BasicLayout = dynamic(() => import("@/core/components/layouts/BasicLayout")) +const ProductSearch = dynamic(() => import("@/lib/product/components/ProductSearch")) +const Brand = dynamic(() => import("@/lib/brand/components/Brand")) export default function BrandDetail() { const router = useRouter() -- cgit v1.2.3 From f66b12fd1d0b83af0d7230d7b1565fbe00afbe3c Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 11:03:34 +0700 Subject: prettier --- src/pages/shop/brands/[slug].jsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/pages/shop/brands/[slug].jsx') diff --git a/src/pages/shop/brands/[slug].jsx b/src/pages/shop/brands/[slug].jsx index da3ee84d..33f81fa2 100644 --- a/src/pages/shop/brands/[slug].jsx +++ b/src/pages/shop/brands/[slug].jsx @@ -1,11 +1,11 @@ -import dynamic from "next/dynamic" -import { getIdFromSlug, getNameFromSlug } from "@/core/utils/slug" -import { useRouter } from "next/router" -import _ from "lodash" +import dynamic from 'next/dynamic' +import { getIdFromSlug, getNameFromSlug } from '@/core/utils/slug' +import { useRouter } from 'next/router' +import _ from 'lodash' -const BasicLayout = dynamic(() => import("@/core/components/layouts/BasicLayout")) -const ProductSearch = dynamic(() => import("@/lib/product/components/ProductSearch")) -const Brand = dynamic(() => import("@/lib/brand/components/Brand")) +const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout')) +const ProductSearch = dynamic(() => import('@/lib/product/components/ProductSearch')) +const Brand = dynamic(() => import('@/lib/brand/components/Brand')) export default function BrandDetail() { const router = useRouter() @@ -13,13 +13,13 @@ export default function BrandDetail() { return ( - { !_.isEmpty(router.query) && ( + {!_.isEmpty(router.query) && ( - ) } + )} ) -} \ No newline at end of file +} -- cgit v1.2.3